import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

//这里导入所有的路由组件
import Home from "../views/Home.vue"
import Answer from "../views/Answer.vue"
import Login from "../views/Login.vue"
import Register from "../views/Register.vue"
import Original from "../views/Original.vue"
import Community from "../views/Community.vue"
import Leisure from "../views/Leisure.vue"
import CallUs from "../views/CallUs.vue"

const routes = [
  {path:"/",redirect: "/home"},
  { path: '/home',
  component: Home,
  name:"Home"
  },
  {
  path:"/answer",
  component:Answer,
  name:"Answer"
  },
  {
    path:"/login",
    component:Login,
    name:"Login"
  },
  {
    path:"/register",
    component:Register,
    name:"register"
  },
  {
    path:"/original",
    component:Original,
    name:"original"
  },
  {
    path:"/community",
    component:Community,
    name:"community"
  },
  {
    path:"/leisure",
    component:Leisure,
    name:"leisure"
  },
  {
    path:"/callUS",
    component:CallUs,
    name:"callUs"
  }
]

const router = new VueRouter({
  mode:"history",
  routes
})

export default router
